<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.one }" var="one"/>
<c:set value="${requestScope.ordersGoodsResponse.data.list }" var="list"/>
<jsp:useBean class="com.wsh.shop.users.pojo.AOrders" id="pojo"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>支付 - 美妆产品销售系统</title>
		<%@ include file="/common/include/title.jsp"%>
	</head>
	<body>
		<jsp:include page="/MainHeadServlet">
            <jsp:param value="header" name="method"/>
        </jsp:include>
		<div id="mainBody">
			<div class="container">
				<div class="row">
					<%@ include file="/common/include/leftBar.jsp"%>
					<form class="form-horizontal" method="post" action="${rootPath }/head/OrdersHeadServlet?method=ordersUpdateSubmit">
						<input type="hidden" name="id" value="${one.id}">
						<input type="hidden" name="operType" value="${param.operType}">
						<div class="span9">
							<ul class="breadcrumb">
								<li><a href="${rootPath }//main">首页</a><span class="divider">/</span></li>
								<li class="active">个人中心</li>
							</ul>
							<table class="table table-bordered">
								<tbody>
									<tr>
										<th>支付</th>
									</tr>
									<tr>
										<td>
											<div class="control-group">
												<label class="control-label" for="receName">支付方式</label>
												<div class="controls">
													<select name="payType">
														<c:forEach items="${pojo.enumsMap }" var="me" varStatus="stat">
															<c:if test="${fn:startsWith(me.key,'PAYTYPE_')}">
																<!-- 拆分,按照-拆分,取最后一个 -->
																<c:set value="${fn:split(me.key, '-')}" var="keys"/>
																<option value="${keys[1] }" ${requestScope.payType == keys[1] ? 'selected' : '' }>${me.value }</option>
															</c:if>
														</c:forEach>
													</select>
												</div>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
							<table class="table table-bordered">
								<thead>
									<tr>
										<th>序号</th>
										<th>商品</th>
										<th>单价</th>
										<th>数量</th>
										<th>总金额</th>
									</tr>
								</thead>
								<tbody>
									<c:set value="0" var="totalMoney"/>
									<c:forEach items="${list }" var="listTemp" varStatus="stat">
										<tr>
											<td>${stat.count }</td>
											<td title="${listTemp.goods.name }">
												<a href="${rootPath }//goodsInfo?id=${listTemp.goodsId}" target="_blank">
													${fn:substring(listTemp.goods.name,0,subStrLen) }
												</a>
											</td>
											<td>${listTemp.goods.price }</td>
											<td>${listTemp.num }</td>
											<td>${listTemp.goods.price * listTemp.num }</td>
											<c:set value="${totalMoney + listTemp.goods.price * listTemp.num }" var="totalMoney"/>
										</tr>
									</c:forEach>
									<tr>
										<td colspan="4" style="text-align: right">
											<strong>总价格 =</strong></td>
										<td class="label label-important" style="display: block">
											<strong>${totalMoney }</strong></td>
									</tr>
								</tbody>
							</table>
							${response.info }
							<button type="submit" class="btn btn-large pull-right">
								提交 <i class="icon-arrow-right"></i>
							</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		<%@ include file="/common/include/footer.jsp"%>
	</body>
</html>